{% extends 'base.html' %}
{% block title %}
    My courses
{% endblock %}



{% block content %}
    <h1>My course</h1>
    <div class="module">
        {% for course in object_list %}
            <div class="course-info">
                <h3>{{ course.title }}</h3>
            </div>
            <p>
                <a href="{% url 'courses:course_edit'  course.id %}">Edit</a>
                <a href="{% url 'courses:course_delete' course.id %}">Delete</a>
                <a href="{% url 'course:course_module_update' course.id %}">Edit modules</a>
                {% if course.module.count > 0 %}
                    <a href="{% url 'course:module_content_list' course.modules.first.id %}">Manage contents</a>
                {% endif %}
            </p>
        {% empty %}
            <p>You haven't any courses yet.</p>
        {% endfor %}
        <p>
            <a href="{% url 'course:course_create' %}" class="button">Create new
                course</a>
        </p>
    </div>
{% endblock %}